var user,password,button
init();
function init(){
    user=document.querySelector("#user");
    password=document.querySelector("#password");
    button=document.querySelector("#button");
    button.addEventListener("click",clcikHandler);
}   

async function clcikHandler(e){
    input=user.value
    pass=password.value
    var o1={
        phone:input,
        password:pass
    }

    var response = await fetch("http://localhost:3860/dl", {
        method: "POST",
        body:JSON.stringify(o1)
    });
    var data=await response.json();
    
   
    if(data==="登录成功"){
        alert("登录成功")
        location.href = "../sass/list.html"
        localStorage.bool=true;
        localStorage.input=user.value
    }else{
        alert("账号或密码错误")
    }
}

